<div class="page detail_agen">
    <div class="container">
        <form method="GET" action="<?php echo site_url('agen/detail/' . $agen[0]->user_id . '/'); ?>">
            <h2>Detail Agen -
                <?php echo $agen[0]->nama_depan . " " . $agen[0]->nama_belakang; ?>
            </h2>
            <div class="row">
                <div class="span3">
                    <div class="span3 infoagen">
                        <div class="row">
                            <div class="span1 fotoagen">
                                <img src="<?php echo base_url(); ?>assets/img/taufan.jpg" class="img-polaroid">
                            </div>
                            <div class="span2">
                                HP: <?php echo $agen[0]->no_hp; ?> <br/>
                                BB: <?php echo $agen[0]->pin_bb; ?> <br/>
                                <a href="#hubungiAgen" data-toggle="modal" class="btn">Kontak Agen</a>

                            </div>
                        </div>
                        <br/>
                        Listing Aktif Dijual: <?php echo $jual; ?><br/>
                        Listing Aktif Disewa: <?php echo $sewa; ?><br/>
                        Spesialisasi Area: <?php echo $agen[0]->spesialisasi_area; ?><br/>
                        Spesialisasi Properti: <br/>
                        Profil: <?php echo $agen[0]->profil; ?><br/>
                        Bahasa yang dikuasai:<br/>
                        Website: <br/>
                    </div>
                    <div class="span3 infoagen">
                        <h4><?php echo $agen[0]->nama_perusahaan; ?><br/></h4>
                        <div class="row">
                            <div class="span2 logoagen">
                                <img src="<?php echo base_url(); ?>assets/img/logo.jpg" class="img-polaroid">
                            </div>
                            <div class="span3 detilagen">
                                Alamat:<br/>
                                <?php
                                echo $agen[0]->jalan . ", " . $agen[0]->kota_kab;
                                ?>
                                <br/>
                                Office: <?php echo $agen[0]->telp_kantor; ?> <br/>
                                Fax: <?php echo $agen[0]->fax; ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="span7 content-detailagen">
                    <?php if (count($result) > 0) {?>
                    <div class="span8">
                        <h4>Daftar Properti</h4>
                    </div>
                    <div class="span7 daftarproperti milikagen">
                        <div class="row">
                            <div class="span5 urutanberdasarkan">
                            Urutkan Berdasarkan:
                            <select name="urutan" value="" class="select-block span2"
                                    onchange="this.form.submit()">
                                <option value="1"
                                <?php if ($this->input->get('urutan') == "1") echo "selected"; ?>
                                        >Listing Terbaru</option>
                                <option value="2"
                                <?php if ($this->input->get('urutan') == "2") echo "selected"; ?>
                                        >Listing Terpopuler</option>
                                <option value="3"
                                <?php if ($this->input->get('urutan') == "3") echo "selected"; ?>
                                        >Harga Min-Maks</option>
                                <option value="4"
                                <?php if ($this->input->get('urutan') == "4") echo "selected"; ?>
                                        >Harga Maks-Min</option>
                                <option value="5"
                                <?php if ($this->input->get('urutan') == "5") echo "selected"; ?>
                                        >Ukuran Besar ke Kecil</option>
                                <option value="6"
                                <?php if ($this->input->get('urutan') == "6") echo "selected"; ?>
                                        >Ukuran Kecil ke Besar</option>
                            </select>
                            </div>
                            <div class="span3 hasilperhalaman">
                            Hasil Perhalaman:
                            <select name="nitem" value="" class="select-block span1"
                                    onchange="this.form.submit()" >
                                <option value="10"
                                <?php if ($this->input->get('nitem') == "10") echo "selected"; ?>
                                        >10</option>
                                <option value="20"
                                <?php if ($this->input->get('nitem') == "20") echo "selected"; ?>
                                        >20</option>
                                <option value="30"
                                <?php if ($this->input->get('nitem') == "30") echo "selected"; ?>
                                        >30</option>
                                <option value="40"
                                <?php if ($this->input->get('nitem') == "40") echo "selected"; ?>
                                        >40</option>
                                <option value="50"
                                <?php if ($this->input->get('nitem') == "50") echo "selected"; ?>
                                        >50</option>
                            </select>
                            </div>
                        </div>
                        <?php
                        $bulan = array(
                            "01" => "Jan",
                            "02" => "Feb",
                            "03" => "Mar",
                            "04" => "Apr",
                            "05" => "Mei",
                            "06" => "Jun",
                            "07" => "Jul",
                            "08" => "Aug",
                            "09" => "Sept",
                            "10" => "Okt",
                            "11" => "Nov",
                            "12" => "Des"
                        );
                        
                            foreach ($result as $value) {
                                ?> 
                                <div class="span8 properti">
                                    <div class="span8 judulproperti">
                                        <h4><?php echo $value->nama_properti; ?></h4>
                                    </div>
                                    <div class="row">
                                        <div class="span2">
                                            <img src="<?php echo base_url(); ?>assets/img/icon.png" class="img-polaroid">
                                            <p class="palette-paragraph jmlfoto">20 Foto</p>
                                            <a href="
                                            <?php echo site_url('listing/detail/' . $value->properti_id); ?>
                                               " class="btn btn-lihatdetail">Lihat Detail</a>
                                            <!-- <a href="#peta" data-toggle="modal" class="btn btn-peta">Peta</a> -->
                                            <!-- <div id="controls"> -->
                                                <!-- <input type="button" class="btn btn-peta" name="showMap" value="PETA" id="showMap" /> -->
                                            <!-- <a class="btn btn-peta" id="showMap">Peta</a> -->
                                            <!-- </div> --> 
                                        </div>
                                        <div class="span4">
                                            <h4>Rp.
                                                <?php
                                                echo number_format($value->harga);
                                                ?>
                                            </h4>
                                            <p> 
                                                <?php
                                                echo $value->nama . " ";
                                                if ($value->sewa_beli == 1) {
                                                    echo "dijual";
                                                } else {
                                                    echo "disewakan";
                                                }
                                                ?>
                                                <br/>
                                            <div class="row">
                                                <div class="span2">
                                                    <p class="palette-paragraph">
                                                        Kamar Mandi:
                                                        <?php echo $value->jml_kmr_mandi; ?> <br />
                                                        Kamar Tidur:
                                                        <?php echo $value->jml_kmr_tidur; ?> <br />
                                                        <?php echo $value->tipe_furnitur; ?>
                                                    </p>

                                                </div>
                                                <div class="span2">
                                                    <p class="palette-paragraph">
                                                        Luas Bangunan:
                                                        <?php echo $value->luas_bangunan; ?>
                                                        m<sup>2</sup> <br/>
                                                        Luas Tanah:
                                                        <?php echo $value->luas_tanah; ?>
                                                        m<sup>2</sup> <br/>
                                                        Sertifikat:
                                                        <?php echo $value->nama_sertifikat; ?>
                                                    </p>
                                                </div>
                                            </div>
                                            <p class="palette-paragraph">( Diiklankan tanggal
                                                <?php
                                                echo substr($value->tgl_update, 8, 2) . " " .
                                                $bulan[substr($value->tgl_update, 5, 2)] . " " .
                                                substr($value->tgl_update, 0, 4);
                                                ?>
                                                )</p>                    
                                            </p>
                                        </div>
                                    </div>
                                </div>
                                <?php
                            }
                        } else {
                            echo "<div class='span6'><h3>Tidak ada memiliki properti</h3></div>";
                        }
                        ?>
                        <center>
                            <div class="paginasi">
                                <?php
                                echo $this->pagination->create_links();
                                ?>
                            </div>
                        </center>
                    </div>
                </div>
            </div>
        </form>
    </div>	
</div>
<div id="hubungiAgen" class="modal hide fade" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
        <h4 id="myModalLabel">Kontak Agen</h4>
    </div>
    <form id="input-form" class="form-horizontal">
        <div class="modal-body">             
            <div class="control-group">
                <label class="control-label" for="titel">Titel:</label>
                <div class="controls">
                    <select name="titel" id="titel" class="span3">
                        <option value="0">Bapak</option>
                        <option value="1">Ibu</option>
                        <option value="2">Sdr/i</option>
                    </select>
                </div> 
            </div>
            <div class="control-group">
                  <label class="control-label" for="name">Nama Anda</label>
                  <div class="controls">
                    <input type="text" class="input-xlarge" name="name" id="name">
                  </div>
            </div>
            <div class="control-group">
                  <label class="control-label" for="name">Alamat E-mail</label>
                  <div class="controls">
                    <input type="text" class="input-xlarge" name="email" id="email">
                  </div>
            </div>
            <div class="control-group">
                  <label class="control-label" for="tel">No. HP</label>
                  <div class="controls">
                    <input type="tel" class="input-xlarge" name="tel" id="tel">
                  </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="sayaAdalah">Saya Adalah</label>
                <div class="controls">
                    <select name="sayaAdalah" id="sayaAdalah" class="select-block">
                        <option value="0">Pembeli</option>
	                    <option value="1">Pemilik</option>
	                    <option value="2">Penyewa</option>
	                    <option value="2">Agen</option>
	                    <option value="2">Investor</option>
	                    <option value="2">Lain-lain</option>
                    </select>
                </div> 
            </div>
            <div class="control-group">
                  <label class="control-label" for="tel">Pesan</label>
                  <div class="controls">
                    <textarea style="width:250px;">Tulis pesan di sini...</textarea>
                  </div>
            </div>
            <label class="checkbox" for="checkbox_berlangganan">
                <input type="checkbox" name="mau_proyek" for="mau_proyek" value="1" id="checkbox_berlangganan" data-toggle="checkbox">
                Saya ingin menerima news letter dari Anda
            </label>
            <label class="checkbox" for="checkbox_info_baru">
                <input type="checkbox" name="mau_info" for="mau_info" value="1" id="checkbox_info_baru" data-toggle="checkbox">
                Saya ingin menerima property news Alert dari ArtyProperty.Com
            </label>
            <div class="span4 offset2">
                <input type="submit" name="SUBMIT"  class="btn btn-primary btn-large span3" value="Submit" />
            </div>
        </div>
    </form>
</div>
<!-- Modal -->
        <div id="foto_properti" class="span5 modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                <h4 id="myModalLabel">Galeri Properti</h4>
            </div>
            <div class="modal-body">
                <div id="carousel-example-generic" class="carousel slide">
                  <!-- Wrapper for slides -->
                  <div class="carousel-inner">
                    <div class="item active">
                      <img src="<?php echo base_url(); ?>assets/img/images1.jpg" width="525px">
                    </div>
                    <div class="item">
                      <img src="<?php echo base_url(); ?>assets/img/images2.jpg" width="525px">
                    </div>
                    <div class="item">
                      <img src="<?php echo base_url(); ?>assets/img/images3.jpg" width="525px">
                    </div>
                  </div>

                  <!-- Controls -->
                  <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                    <span class="icon-prev"></span>
                  </a>
                  <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                    <span class="icon-next"></span>
                  </a>
                </div>

            </div>
        </div>
<script type="text/javascript">
$(function() {
    $('.carousel').carousel({
        interval: 3000
    });
  });
</script>